#!/bin/bash
while :
do
echo "===================="
echo "1.增加用户并增加密码"
echo "2.删除用户"
echo "3.查看用户"
echo "4.退出"
echo "===================="
read -p "请选择您所需要的服务:" ser
if (($ser!=1)) && (($ser!=2)) && (( $ser!=3 )) && (( $ser!=4 ))
then
	echo "请输入正确的选项"
fi
case $ser in
1)
	read -p "创建用户名:" user1
	useradd $user1 
	read -s -p "设置密码:" passwd1
	echo $passwd1|passwd $user1 --stdin&>/dev/null
	#read -p "密码设置:" passwd1
	
	#$passwd
	;;
2)
	read -p "删除用户:" user2
	userdel -r $user2
	;;
3)
	read -p "查看用户:" user3
	id $user3
	;;
4)
	exit 
esac
done	
	

